package com.learn.admin.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/test")
public class TestController {

	@Autowired
	RestTemplate restTemplate;

	@RequestMapping("/micro")
	public ResponseEntity<String> getMicroInstance() {
		return (ResponseEntity<String>) restTemplate.getForEntity("http://micro-service/instance/info", String.class);
	}

}
